<%@ page import="com.entity.User" %>
<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <c:url var="base" value="/"/>
    <base href="${base}">
    <meta charset="UTF-8">
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .login{
            display: block;
            position: absolute;
            right: 20px;
            top: 20px;
        }
        .logbtn {
            display: inline-block;
            background-color: #23a9ff;
            color: white;
            padding: 5px 15px;
            font-weight: 600;
            margin: 0;
            text-decoration: none;
        }
        .logbtn:hover{
            background-color: #617581;
            transform: scale(1.1);
            /*box-shadow: 2px 2px 0px 2px rgba(190, 190, 190, 0.9);*/
        }
        .logout{
            background-color: #ea995d;
        }
        .loginb{
            background-color: #32a162;
        }
    </style>
</head>
<body>
<div class="login">
    <% User user=(User)session.getAttribute("user"); if(user!=null){%>
    <div class="logbtn">欢迎您，${user.name}!</div>
    <a class="logbtn" href="newsmanage">后台管理</a>
    <a class="logbtn logout" href="logout">登出</a>
    <%}else{ %>
    <a class="logbtn loginb" href="login">登录</a>
    <%}%>
</div>
</body>
</html>